<template>
  <div>
    <div class="list_banner">
      <p>技术与问题</p>
    </div>
    <div class="animate__animated animate__fadeInLeft container">
      <el-row :gutter="20">
        <el-col :span="8" v-for="item of articleList" :key="item.id" :xs="24">
          <!-- 文章 -->
          <el-card class="animated zoomIn article-item-card">
            <div class="article-item-cover">
              <router-link :to="'/article/' + item.id">
                <!-- 缩略图 -->
                <img
                  class="on-hover"
                  :src="item.first_picture"
                  width="100%"
                  height="100%"
                />
              </router-link>
            </div>
            <div class="article-item-info">
              <!-- 文章标题 -->
              <div style="font-weight: bold">
                <router-link :to="'/article/' + item.id">
                  {{ item.title }}
                </router-link>
              </div>
              <div style="margin-top: 0.375rem">
                <!-- 发表时间 -->
                <i class="el-icon-time"></i>
                {{ item.create_time | dataFormat }}
                <!-- 文章分类 -->
                <span style="float: right">
                  <i class="el-icon-star-on"></i>{{ item.blog_type }}
                </span>
              </div>
            </div>
          </el-card>
        </el-col>
      </el-row>
    </div>
  </div>
</template>
<script>
import { getblogs, searchEssay } from "@/request/api";
export default {
  name: "",
  components: {},
  props: [""],
  data() {
    return {
      totalcount: 0,
      queryInfo: {
        title: "",
        typeId: "",
      },
      pagenum: 1,
      pagesize: 6,
      articleList: [],
    };
  },
  created() {
    this.getBlogList();
  },
  mounted() {},
  methods: {
    changePage(page) {
      this.pagenum = page;
      this.getBlogList();
    },
    // 获取博客列表
    async getBlogList() {
      const { data: res } = await getblogs({
        query: this.queryInfo.title,
        typeId: this.queryInfo.typeId,
        pagenum: this.pagenum,
        pagesize: this.pagesize,
      });

      this.articleList = res.data;
      this.totalcount = res.total;
    },
  },
};
</script>
<style lang='less' scoped>
.list_banner {
  background: url("@/assets/image/banner5.jpg") no-repeat;
  background-size: 100% 100%;

  position: relative;
  width: 100%;
  height: 200px;
}
.list_banner p {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  position: absolute;
  top: 70%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: block;
  padding: 5px 10px;
  border-radius: 5px;
  background: #3333334d;
}
.container {
  margin-top: 15px;
  height: 32em;
  margin-bottom: 100px;
}
.article-item-card {
  border-radius: 8px !important;
  box-shadow: 0 4px 8px 6px rgba(7, 17, 27, 0.06);
  margin-bottom: 15px;
  font-size: 16px;
}
.article-item-card a {
  transition: all 0.3s;
}
.article-item-cover {
  height: 220px;
  overflow: hidden;
}
.article-item-card a:hover {
  color: #8e8cd8;
}
@media only screen and (max-width: 992px) {
}
</style>